﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ActionReporter;
using InputHandler;
using KnowledgeBase;
using KnowledgeBaseIntermediary;

namespace LisaCore
{
    /// <summary>
    /// Lisa's Runmode. If she's running in Debug mode, she can use an ActionReporter component to report her
    /// actions back to an external Testing component (Ex: A GUI which logs her actions/decisions/state changes etc).
    /// If she's running in realtime mode, she wouldnt be reporting back to anything.
    /// </summary>
    public enum RUNMODE { DEBUG, REALTIME };

    /// <summary>
    /// This interface allows external components to access Lisa's Core. Lisa's core handles the central logical
    /// decisions.
    /// </summary>
    public interface ICore
    {
        #region Accessors
        /// <summary>
        /// Obtains the Runmode that Lisa is in. This can typically either be DEBUG or REALTIME. If Lisa is in DEBUG mode, she
        /// reports her actions to the ActionReporter. External components (such as a Test GUI or a Logger) can listen for
        /// the different events of the ActionReporter.
        /// </summary>
        RUNMODE RunMode
        {
            get;
            set;
        }

        /// <summary>
        /// The ActionReporter reports Lisa's actions to any listening component. Components can register at the
        /// ActionReporter and be informed about what Lisa is doing at run-time. This allows for easier
        /// testing and debugging of Lisa's Core.
        /// </summary>
        IActionReporter ActionReporter
        {
            get;
            set;
        }
        #endregion

        #region Primary interface methods
        /// <summary>
        /// Initializes the Core Unit.
        /// </summary>
        void initialize();

        /// <summary>
        /// Starts the Core.
        /// </summary>
        void start();

        /// <summary>
        /// Stops the Core.
        /// </summary>
        void stop();

        /// <summary>
        /// Returns an InputHandler for debugging purposes. This is useful if a GUI starts Lisa and wants to access
        /// its InputHandler for debugging purposes.
        /// </summary>
        /// <returns></returns>
        IInputHandlerDebug getInputHandler();
        #endregion

        #region The following methods are only used if Lisa's in Debug mode

        /// <summary>
        /// This method simulates a potential state change. The new state to which Lisa could potentially switch
        /// is passed in the parameters. This method only works if Lisa's in Debug Mode.
        /// </summary>
        /// <param name="newState">The new state to which Lisa could potentially switch.</param>
        void createPotentialStateChange(StateDTO newState);

        /// <summary>
        /// This method simulates the receipt of a user command. This includes the receipt of user-permissions etc.
        /// </summary>
        /// <param name="command">The in-state command or scene.</param>
        void simulateCommandReceipt(String command);

        #endregion
    }
}
